package com.zrar.award.test.view;

import java.awt.BorderLayout;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.GridLayout;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.File;
import java.util.ArrayList;
import java.util.List;

import javax.swing.JButton;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.UIManager;

import com.zrar.award.test.ExcelUtil;
import com.zrar.award.test.SystemUtil;
import com.zrar.award.test.entity.AnswerPeople;
import com.zrar.award.test.entity.Prize;

public class MainView  {

	static List<AnswerPeople> peoples = new ArrayList<AnswerPeople>();
	static List<Prize> prizes = new ArrayList<Prize>();
				
	static final int WIDTH=400;
    static final int HEIGHT=500;
    
	public MainView() {	 		
		JFrame frame = new JFrame("FileChooser Example");
		frame.setSize(WIDTH,HEIGHT);
		DisplayJPanel displayJPanel = new DisplayJPanel(peoples,prizes);
		try {
			// 将LookAndFeel设置成Windows样式
			UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
		} catch (Exception ex) {
			ex.printStackTrace();
		}

		frame.setContentPane(displayJPanel);
		//frame.pack();
		SystemUtil.showInCenter(frame);
		frame.setVisible(true);
		
		frame.addWindowListener(new WindowAdapter() {
			public void windowClosing(WindowEvent e) {
				System.exit(0);
			}
		});
	}

	public static void main(String[] args) {
		new MainView();
	}

	
}
